﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

namespace fbasync.web.Controls
{
    public partial class ErrorText : System.Web.UI.UserControl, IExceptionHandler
    {
        protected override void OnInit(EventArgs e)
        {
            ExceptionHandler.RegisterExceptionHandler(this);

            base.OnInit(e);
        }

        protected override void OnLoad(EventArgs e)
        {
            uiErrorText.Text = String.Empty;

            base.OnLoad(e);
        }

        #region IExceptionHandler Members

        public void HandleException(Exception ex)
        {
            uiErrorText.Text = null == ex ? String.Empty : ex.Message.Replace("\n", "<br>");
        }

        #endregion
    }
}